include( 'shared.lua' )


function ENT:CalcView( ply, origin, angles, fov )

	local viewdistance = 126
	
	local vec = ply:GetAimVector()
	local org = (vec * -viewdistance)

	local tr = util.QuickTrace(origin, org, ply)
	
	org = ((tr.Hit && (tr.HitPos + (vec * 8))) || tr.HitPos)
	
	local organg = ply:GetAngles()
	
	ply:SetEyeAngles( 0, organg.y, organg.r )
	
	local view = {}
	view.origin = org
	view.angles = angles

	return view

end